#include<iostream>
using namespace std;
#include<vector>
#include<string>

#include<deque>
#include<algorithm>

class person
{
	public:
		person(string name, int score) {
			this->mname = name;
			this->mscore = score;

		}


		string mname;
		int mscore;

};

void creatperson(vector<person>& v) {
	string nameseed = "abcde";
	for (int i = 0; i < 5; i++) {
		string name = "xuanshou";
		name += nameseed[i];
		int score = 0;
		person p(name, score);

		v.push_back(p);
	}

	




}
void setscore(vector<person>& v) {
	for (vector<person>::iterator it = v.begin(); it != v.end(); it++) {

		deque<int>d;

		for (int i = 0; i < 10; i++) {
		
			int score = rand()%41+60;
			

			d.push_back(score);
		}
		for (deque<int>::iterator dit = d.begin(); dit != d.end(); dit++) {
			cout<<*dit<<" ";
		}
		cout << endl;

		sort(d.begin(), d.end());
		d.pop_back();
		d.pop_front();
		int sum = 0;
		for (deque<int>::iterator dit = d.begin(); dit != d.end(); dit++) {
			sum += *dit;
		}
		int avg = sum / d.size();
		it->mscore = avg;
	}

}
void showscore(vector<person>& v) {
	for (vector<person>::iterator it = v.begin(); it != v.end(); it++) {
		cout << it->mscore << endl;
	}

}



int main() {

	vector<person>v;
	creatperson(v);
	setscore(v);
	showscore(v);
	system("pause");
	return 0;
}